import request1 from "@/utils/request1";




export interface tradeDataLsit {
        "consignee":string,
        "consigneeTel":string,
        "deliveryAddress":string,
        "paymentWay":string,	
        "orderComment":string,	
        "orderDetailList":[]
}
export interface weixindata{
        "orderId": number,
        "totalFee": number,
        "resultCode": string,
        "codeUrl": string
}

export const getaddress=(tradeNo:string,params:tradeDataLsit)=>{
        return request1.post<any,tradeDataLsit>(`/api/order/auth/submitOrder?tradeNo=${tradeNo}`,params)
    }

export const gettrade = () =>{
    return request1.get('/api/order/auth/trade')
}

export const getaddressList = () => {
    return request1.get('/api/user/userAddress/auth/findUserAddressList')
}

export const getweixin = (orderId:string) => {
    return request1.get<any,weixindata>(`/api/payment/weixin/createNative/${orderId}`)
}

export const getpaystatus = (id:any) => {
    return request1.get(`/api/payment/weixin/queryPayStatus/${id}`)
}